﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace W1
{
    class User
    {
        //1. 定义一个用户类，存放用户的账号、用户名和密码属性；
        //2. 在用户类中定义一个方法输出当前用户对象的账号、用户名和密码的信息；然后在主方法调用输出；
        private int account;
        private string username;
        private int password;
        public int Account { get; set; }
        public string Username { get; set; }
        public int Password { get; set; }
        public void Login()
        {
            Console.WriteLine("您的账号为：{0} 用户名为：{1} 密码为：{2}",this.Account,this.Username,this.Password);
        }
        static void Main(string[] args)
        {
            User user = new User();
            //user.Account = 123;
            //user.Username = "管理员";
            //user.Password = 123;
            string [] arr = new string[3];
            for (int i = 0; i < 3; i++)
            {
                switch (i)
                {   
                    case 0:
                        Console.WriteLine("请输入账号（数字）");
                        arr[i] = Console.ReadLine();
                        int num = int.Parse(arr[i]);
                        user.Account = num;
                        break;
                    case 1:
                        Console.WriteLine("请输入用户名");
                        arr[i] = Console.ReadLine();
                        user.Username = arr[i];
                        break;
                    case 2:
                        Console.WriteLine("请输入密码(数字)");
                        arr[i] = Console.ReadLine();
                        int num1 = int.Parse(arr[i]);
                        user.Password = num1;
                        break;
                    
                    default:
                        break;
                }
            }
            user.Login();
        }
    }
}
